window.onload=function(){
	getimage=function (imgtab){
		var div1 = document.getElementById('div1')
		for (var i = 0; i < imgtab.length; i++) {
			if (i<500) {
				var img = document.createElement('img')
				
				img.setAttribute('src', imgtab[i])
				div1.appendChild(img)
			}
			
		}
	}
	getmp4=function(videosrc){
			
			//得到 viode id
							alert(videosrc)
			                videoElem = document.getElementById("video");
			//在video 写入（<source>）
			                videoElem.innerHTML = '<source class="source" src="' + videosrc + '" type="video/mp4">';
			//视频自动播放   

			
		
		}
	
}

btn1 = document.getElementById('btn_openimg')
btn2=document.getElementById('btn_opentext')
btn2clicked= function(val) {
	
	var div1 = document.getElementById('div1')
	
		var text = document.createElement('div')
		text.innerText = val
		div1.appendChild(text)	

}
btn2.onclick=btn2clicked("dfkdjfkdjf")
colorchoose = document.getElementById('btn_setcolor')
colorchoose.onchange = function() {
	var div1 = document.getElementById('div1')
	div1.style.backgroundColor = this.value
}
btn3 = document.getElementById('btn_openpdf')
btn3.onclick = function() {
	path = aardio.openpdf()
	var div1 = document.getElementById('div1')
	path.then((val) => {
		var pdfdiv = document.createElement('iframe')
		pdfdiv.setAttribute("src", val)
		pdfdiv.setAttribute("frameborder", 0)
		div1.appendChild(pdfdiv)

	})


}
